package controller

import (
	"workflow/service"

	"github.com/gin-gonic/gin"
)

func ListHistoryController(c *gin.Context) {
	workflowID, ok := c.GetQuery("id")
	if !ok {
		panic(ok)
	}

	history, err := service.ListHistory(workflowID)
	if err != nil {
		SendError(c, err)
	}

	SendData(c, history)
}
